
let path = require("path");
// let ip = require("ip");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  lintOnSave: false,
  chainWebpack: (config) => {
    config.resolve.alias.set("@", resolve("./src"));
  },
  devServer: {
    host: "0.0.0.0",
    open: true,
    proxy: {
      "/dev-api": {
        target: "http://localhost:8888/",
        // ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/dev-api": "",
        },
      },
      "/prod-api": {
        target: "https://localhost:8888/",
        // ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/prod-api": "",
        },
      },
      "/stage-api": {
        target: "https://localhost:8888/",
        // ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/stage-api": "",
        },
      },
    },
  },
};
